package com.android.lib.download.entity

data class DownloadInfo(
    var url: String = "",
    var path: String? = null,
    var fileName: String? = null,
    var progress: Int = 0,
    var contentLength: Long = -1,
    var currentLength: Long = 0,
    var status: Int = NONE
) {
    companion object Status {
        const val NONE = 0  //无状态
        const val WAITING = 1 //等待中
        const val DOWNLOADING = 2 //下载中
        const val PAUSE = 3 //暂停
        const val ERROR = 4 //错误
        const val DONE = 5 //完成
    }

    /**
     * 重置任务
     */
    fun reset() {
        currentLength = 0
        contentLength = -1
        status = NONE
        progress = 0
    }
}
